<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

<script>
    // async function method1() {
    //     // return 100;
    //     // return Promise.resolve("success")
    //     return Promise.reject("error")
        
    // }


    async function method1() {
        try{
            console.log("业务代码执行完毕");
            throw new Error(err);
            
        }catch(err){
                throw new Error(err)
        }
    }

 let result = method1();
//  console.log(result);
 

result.then(
    (res)=>{
        console.log("异步线程执行结果"+res); 
    }
).catch(
    (err)=>{
        console.log("异步线程执行失败"+err);
        
    }
)

 console.log("主线程");
 


</script>








</head>
<body>
    
</body>
</html>